var app = angular.module('login',[]);

app.controller('loginCon',function($scope,$http){
    $scope.submit = function(){
        var name = document.querySelector('#name').value;
        var password = document.querySelector('#password').value;
        $http.post('/admin',{'name':name,'password':password})
            .success(function(data){
                console.log(data);
                if(data['success']===true){
                    window.location.href = "/manage";
                }
            }).error(function(data){
                console.log(data);
            })
    }
});
